public class MethodDetail {
	public static void main(String[] args) {
		AA aa1 = new AA();
		int[] a = aa1.getSumAndSub(1, 2);
		for(int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}
		System.out.println();
	}
}

class AA {
	public int[] getSumAndSub(int n1, int n2) {
		int resArr[] = new int[2];
		resArr[0] = n1 + n2;
		resArr[1] = n1 - n2;
		return resArr;
	}
}